#ifndef RK_MPI_API_
#define RK_MPI_API_
#include "rkmpp/rk_mpi.h"

//#include "mpp_log.h"
//#include "mpp_mem.h"
//#include "mpp_env.h"
//#include "mpp_time.h"
//#include "mpp_common.h"

//#include "utils.h"



typedef enum {
	RKMPII_EC_SUCCESS	= 0,
	RKMPII_EC_INITERR,
	RKMPII_EC_GETFRAME,
	RKMPII_EC_INITPACKET,
	RKMPII_EC_PUTPACKET,
	RKMPII_EC_NOK,
	RKMPII_EC_MPIRESET,
	RKMPII_EC_TOMPIIFRAME,
	RKMPII_EC_DECNOFRAME,
	RKMPII_EC_DECERROR,

}RKMPII_errCode;


typedef struct {
	RK_U32 width;
	RK_U32 height;
	RK_U32 h_stride;
	RK_U32 v_stride;
    RK_S64  pts;
    RK_S64  dts;	

	RK_U8 *datapts; //The internal release
	MppFrameFormat fmt;
}RKMPII_Frame;

typedef struct {
	RK_U8 * data;
	RK_U32 data_size;
	RK_S64 pts;
	RK_S64 dts;	
}RKMPII_Packet;




typedef struct {
	void *rkmpiiPrivate;
	
    MppCodingType codingType;	
	RK_U32 width;
	RK_U32 height;


	RK_U8 * extradata;
	RK_U32 extradata_size;		
	





}RKMPII_Context;

RKMPII_errCode rkMpii_decodec_frame(RKMPII_Context *rkmpiiCtx, RKMPII_Packet *inMpiiPacket, RKMPII_Frame *outMpiiFrame);
RKMPII_errCode rkMpii_codec_flush(RKMPII_Context *rkmpiiCtx);
RKMPII_errCode rkMpii_codec_deinit(RKMPII_Context *rkmpiiCtx);
RKMPII_errCode rkMpii_codec_init(RKMPII_Context *rkmpiiCtx);
void dump_mpp_frame_to_fb0(MppFrame frame);


#endif
